package cn.bb.action;

import cn.bb.pojo.Person;
import cn.bb.service.IPersonService;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public class PersonAction extends ActionSupport {
    private IPersonService iPersonService;
    public String list(){
        List<Person> list = iPersonService.search();
        HttpServletRequest httpServletRequest = ServletActionContext.getRequest();
        httpServletRequest.setAttribute("list",list);
        return SUCCESS;
    }
    public IPersonService getiPersonService() {
        return iPersonService;
    }

    public void setiPersonService(IPersonService iPersonService) {
        this.iPersonService = iPersonService;
    }
}
